package com.yeban.base.day04.homework;

import java.util.Scanner;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/28
 */

//需求1：定义整型数组，从键盘输入5个元素，并求其最大值
public class Test01 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.print("请输入五个整数（用空格隔开）：");

        int[] arr = new int[5];
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = sc.nextInt();
            if(arr[i] > max) {
                max = arr[i];
            }
        }

        System.out.println("这五个数的最大值为：" + max);
        System.out.println();
    }
}
